package com.lq.learningTest.duoxiancheng;

import java.util.concurrent.locks.ReentrantLock;

public class ReentrantLockTest {
    private static final ReentrantLock lock = new ReentrantLock();

    public static void say(){
//            lock.lock();
            try{
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("hello");
                System.out.println("-------"+Math.random()+"--------");
            }finally {
//                lock.unlock();
            }



    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(()->{
                say();
            }).start();
        }
    }
}
